package com.mvprxjavartrofit.ui.home;

import android.content.ContentResolver;

import com.mvprxjavartrofit.base.BaseModel;
import com.mvprxjavartrofit.base.BasePresenter;
import com.mvprxjavartrofit.base.BaseView;
import com.mvprxjavartrofit.entity.User;

import java.util.List;

/**
 * Created by Administrator
 * At 2016/10/20/17:15/2016
 * Project test
 */
public interface HomeContract {
    interface Model extends BaseModel{

        interface ShowListener{
            void show(List<User> users);
        }

        boolean insert(ContentResolver resolver);

        boolean query(ContentResolver resolver
                , String selection, String[] selectionArgs
                , ShowListener listener);

        boolean delete(ContentResolver resolver
                , String selection, String[] selectionArgs);

        boolean update(ContentResolver resolver
                , String selection ,String[] selectionArgs);
    }

    interface View extends BaseView {
        void showQuery(List<User> users);
    }

    abstract class Presenter extends BasePresenter<Model, View>{

        public abstract boolean insert(ContentResolver resolver);

        public abstract boolean query(ContentResolver resolver
                , String selection, String[] selectionArgs);

        public abstract boolean delete(ContentResolver resolver
                , String selection, String[] selectionArgs);

        public abstract boolean update(ContentResolver resolver
                , String selection ,String[] selectionArgs);

        @Override
        public void onStart() {

        }
    }
}
